package com.pushtalk.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class ConfigUtil {

	protected static final Logger LOG = LoggerFactory.getLogger(ConfigUtil.class);
	
	public static Properties getProperties() throws FileNotFoundException, UnsupportedEncodingException {
	// 生成输入流
	File f=new File("config.properties");
	FileInputStream ins=new FileInputStream(f);
	// 生成properties对象
	Properties p = new Properties();
	try {
		p.load(ins);
		return p;
	} catch (Exception e) {
		LOG.error("读取配置文件过程中出错",e);
		return null;
	}
	finally{
		try {
			ins.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
}
